package com.global.test.chain.command;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.global.emc.core.CoreUser;
import com.global.emc.core.exception.impl.EMCException;
import com.global.emc.security.user.CoreUserChain;
import com.global.emc.spring.method.support.chain.BeforeCallMethodContent;
import com.global.emc.spring.method.support.chain.command.AbstractBeforeCallMethodCommand;

/**   
 *  
 * @Description:  [用一句话描述该文件做什么]   
 * @Author:       [Joly_Huang]   
 * @CreateDate:   [2014年3月20日 下午2:39:58]   
 * @UpdateUser:   [Joly_Huang]   
 * @UpdateDate:   [2014年3月20日 下午2:39:58]   
 * @UpdateRemark: [说明本次修改内容]  
 * @Version:      [v1.0] 
 *    
 */
@Component
public class LoginBCMCommand extends AbstractBeforeCallMethodCommand {
	
	private CoreUserChain coreUserChain;
	
	public CoreUserChain getCoreUserChain() {
		return coreUserChain;
	}
	@Resource(name="loginCoreUserChain")
	public void setCoreUserChain(CoreUserChain coreUserChain) {
		this.coreUserChain = coreUserChain;
	}


	@Override
	public void execute(BeforeCallMethodContent content) throws EMCException {
		CoreUser coreUser = super.findObject(content, CoreUser.class);
		coreUserChain.invoker(coreUser);
	}

}
